//
//  MenuFirstModel.m
//  Products_B
//
//  Created by lanou on 16/5/30.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuFirstModel.h"

@implementation MenuFirstModel

+ (NSMutableArray *)modelConfigureWithDic:(NSDictionary *)jsonDic{
    NSMutableArray *modelArray = [NSMutableArray array];
    NSArray *dataArray = jsonDic[@"data"][@"data"];
    for (NSDictionary *dataDic in dataArray) {
        
        MenuFirstModel *model = [[self alloc]init];
        model.page_title = jsonDic[@"data"][@"page_title"];
        model.descriptiont = dataDic[@"description"];
        [model setValuesForKeysWithDictionary:dataDic];
        model.bigSpArray = [NSMutableArray array];
        for (NSDictionary *bigDic in dataDic[@"tags_info"]) {
            [model.bigSpArray addObject:bigDic[@"text"]];
        }
        [modelArray addObject:model];
    }
    return modelArray;
}
+ (MenuFirstModel *)modelConfigureWithJsonDic:(NSDictionary *)jsonDic{
    MenuFirstModel *model = [[self alloc]init];
    NSDictionary *dataDic = jsonDic[@"data"];
    [model setValuesForKeysWithDictionary:dataDic];
    model.bigSpArray = [NSMutableArray array];
    for (NSDictionary *tags_infoDic in dataDic[@"tags_info"]) {
        [model.bigSpArray addObject:tags_infoDic[@"text"]];
    }
    NSLog(@"%@,%ld",model.cooking_time,model.bigSpArray.count);
    return model;
}

@end
